<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$setting=$this->plugin_setting('setting');
$member=$this->pdo_get('member',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
$sale_mid=$_RQ['sale_mid'];
if($sale_mid){
	$update=array('sale_mid'=>$sale_mid);
	if($member['is_agent']){
		$share_link=$return['pluginset']['share_link']?:'jy_baojfee/index/';
		exi('','',$share_link);
	}else{
		$this->model('member')->member_update($_SESSION['uid'],$update);
	}
}
if($_RQ['footernav']){
	$return['pluginset']['footernav']=plugin($_RQ['footernav'])->plugin_setting('setting')['footernav'];
}
$mid=$_RQ['mid']?$_RQ['mid']:$_SESSION['uid'];
$sao_fromuser=$this->session('sao_fromuser');
if($_RQ['fromuser'] || $sao_fromuser){
		if($_RQ['fromuser'] && !$sale_mid && ($this->setting['become']==5 || $this->setting['become_child']==4 || $this->setting['become_child']==1)){
			$this->session('becomefromuser',$_RQ['fromuser']);
			$this->model('member')->checkmember('',false);
		}
		$_RQ['fromuser']=$_RQ['fromuser']?:$sao_fromuser;
		$team=$this->pdo_get('member',array('mid'=>$_RQ['fromuser'],'uniacid'=>$_SESSION['uniacid']));
		$teamlevel =$this->pdo_get('level',array('id'=>$team['level_id'],'uniacid'=>$_SESSION['uniacid']));
		$teamlevel['title'] = $teamlevel['title']?:'普通会员';
		//扫码成为下线
		if($_RQ['fromuser'] && ($this->setting['become_child']==4 || $this->setting['become_child']==1) && !$member['agent_id']){
			$this->model('member')->set_parent($_SESSION['uid'],$_RQ['fromuser']);
		}
		$this->session('sao_fromuser','');
}
$nowplugin=$_SESSION['current_plugin']=='core'?'jy_weishop':$_SESSION['current_plugin'];
$menus_index=$_SESSION['menus_index']?:$nowplugin.'/index/';
exi('','',$return['pluginset']['share_link']?:$menus_index);
?>